/**
 * <copyright>
 * </copyright>
 *

 */
package org.xtext.example.mydsl.myDsl.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.xtext.example.mydsl.myDsl.DimensionVA;
import org.xtext.example.mydsl.myDsl.LayoutDimensionKind;
import org.xtext.example.mydsl.myDsl.LayoutDimensionVA;
import org.xtext.example.mydsl.myDsl.MyDslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Dimension VA</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.example.mydsl.myDsl.impl.DimensionVAImpl#getConst_value <em>Const value</em>}</li>
 *   <li>{@link org.xtext.example.mydsl.myDsl.impl.DimensionVAImpl#getValue <em>Value</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DimensionVAImpl extends ValueAccessImpl implements DimensionVA
{
  /**
   * The default value of the '{@link #getConst_value() <em>Const value</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConst_value()
   * @generated
   * @ordered
   */
  protected static final LayoutDimensionKind CONST_VALUE_EDEFAULT = LayoutDimensionKind.FILL_PARENT;

  /**
   * The cached value of the '{@link #getConst_value() <em>Const value</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConst_value()
   * @generated
   * @ordered
   */
  protected LayoutDimensionKind const_value = CONST_VALUE_EDEFAULT;

  /**
   * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getValue()
   * @generated
   * @ordered
   */
  protected static final String VALUE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getValue()
   * @generated
   * @ordered
   */
  protected String value = VALUE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected DimensionVAImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return MyDslPackage.Literals.DIMENSION_VA;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public LayoutDimensionKind getConst_value()
  {
    return const_value;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setConst_value(LayoutDimensionKind newConst_value)
  {
    LayoutDimensionKind oldConst_value = const_value;
    const_value = newConst_value == null ? CONST_VALUE_EDEFAULT : newConst_value;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.DIMENSION_VA__CONST_VALUE, oldConst_value, const_value));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getValue()
  {
    return value;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setValue(String newValue)
  {
    String oldValue = value;
    value = newValue;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.DIMENSION_VA__VALUE, oldValue, value));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MyDslPackage.DIMENSION_VA__CONST_VALUE:
        return getConst_value();
      case MyDslPackage.DIMENSION_VA__VALUE:
        return getValue();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case MyDslPackage.DIMENSION_VA__CONST_VALUE:
        setConst_value((LayoutDimensionKind)newValue);
        return;
      case MyDslPackage.DIMENSION_VA__VALUE:
        setValue((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.DIMENSION_VA__CONST_VALUE:
        setConst_value(CONST_VALUE_EDEFAULT);
        return;
      case MyDslPackage.DIMENSION_VA__VALUE:
        setValue(VALUE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.DIMENSION_VA__CONST_VALUE:
        return const_value != CONST_VALUE_EDEFAULT;
      case MyDslPackage.DIMENSION_VA__VALUE:
        return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
  {
    if (baseClass == LayoutDimensionVA.class)
    {
      switch (derivedFeatureID)
      {
        case MyDslPackage.DIMENSION_VA__CONST_VALUE: return MyDslPackage.LAYOUT_DIMENSION_VA__CONST_VALUE;
        default: return -1;
      }
    }
    return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
  {
    if (baseClass == LayoutDimensionVA.class)
    {
      switch (baseFeatureID)
      {
        case MyDslPackage.LAYOUT_DIMENSION_VA__CONST_VALUE: return MyDslPackage.DIMENSION_VA__CONST_VALUE;
        default: return -1;
      }
    }
    return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (const_value: ");
    result.append(const_value);
    result.append(", value: ");
    result.append(value);
    result.append(')');
    return result.toString();
  }

} //DimensionVAImpl
